loadModel
open override fun <T : InferenceModel, U : InferenceModel> loadModel(modelType: ModelType<T, U>, loadingMode: LoadingMode): T
Content copied to clipboard
Loads model configuration without weights.
Return
An example of OnnxInferenceModel.
Parameters
loadingMode
Strategy of existing model use-case handling.
fun loadModel(modelType: OnnxModelType<*>, vararg executionProviders: ExecutionProvider, loadingMode: LoadingMode = LoadingMode.SKIP_LOADING_IF_EXISTS): OnnxInferenceModel
Content copied to clipboard
This method loads model from ONNX model zoo corresponding to the specified modelType. The loadingMode parameter defines the strategy of existing model use-case handling. If loadingMode is LoadingMode.SKIP_LOADING_IF_EXISTS and the model is already loaded, then the model will be loaded from the local cacheDirectory. If loadingMode is LoadingMode.OVERRIDE_IF_EXISTS the model will be overridden even if it is already loaded. executionProviders is a list of execution providers which will be used for model inference.